<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>管理系统</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="<?php echo STATIC_ADMIN; ?>bootstrap/css/bootstrap.min.css">

    <!-- Font Awesome -->
    <link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="//cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css">

    <link rel="stylesheet" href="<?php echo STATIC_ADMIN; ?>dist/css/AdminLTE.css">
    <link rel="stylesheet" href="<?php echo STATIC_ADMIN; ?>dist/css/skins/_all-skins.css">

    <link rel="stylesheet" href="<?php echo STATIC_ADMIN; ?>dist/css/yc_style.css">

    <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.3/html5shiv.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue fixed layout-boxed" onresize="iframeHeight();">
<div class="wrapper">
    <!-- header -->
    <?php $this->load->view('public/header');?>
    <!-- header end -->

    <!-- left sidebar -->
    <?php $this->load->view('public/left');?>
    <!-- left sidebar end -->

    <!-- main -->
    <div class="content-wrapper">
        <iframe src="<?php echo base_url('Index/home');?>" id="main" name="main" width="100%" height="100%" scrolling="auto" frameborder="0" style="margin: 0;padding: 0;background-color: transparent;margin-bottom:-5px;"></iframe>
    </div>
    <!-- main end  -->

    <!-- footer -->
    <?php $this->load->view('public/footer');?>
    <!-- footer end -->
</div>
<!-- ./wrapper -->

<div class="modal fade" id="userSafeModal" tabindex="-1" role="dialog" aria-labelledby="userSafeModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <a href="javascript:void(0);" class="close" data-dismiss="modal" aria-label="Close" role="button"><span aria-hidden="true">&times;</span></a>
                <h4 class="modal-title" id="userSafeModalLabel">账号安全</h4>
            </div>
            <form class="form-horizontal" name="user_safe" id="user_safe" method="post" action="<?php echo site_url('Index/user_safe/'.$this->admin_auth->get_user_info('user_id'));?>">
            <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">用户名</label>
                        <div class="col-sm-10">
                            <p class="form-control-static"><?php echo $this->admin_auth->get_user_info('user_name');?></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">所属角色</label>
                        <div class="col-sm-10">
                            <p class="form-control-static"><?php echo $this->admin_auth->get_user_info('user_role');?></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="user_email" class="col-sm-2 control-label">邮箱</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="user_email" name="user_email" placeholder="邮箱"
                                   datatype="yes_null|e"
                                   nullmsg="请填邮箱"
                                   errormsg="邮箱格式不正确"
                                   value="<?php echo $this->admin_auth->get_user_info('user_email');?>">
                            <div class="Validform_checktip"></div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="user_pass" class="col-sm-2 control-label">新密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="user_pass" name="user_pass"
                                   datatype="yes_null|scope_string_2,*6-20"
                                   nullmsg="登录密码不能为空"
                                   errormsg="登录密码必须包含英文字母与数字，长度在6~20位之间"
                                   placeholder="新密码">
                            <div class="Validform_checktip">不修改请留空。登录密码必须包含英文字母与数字，长度在6~20位之间</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="user_pass_confirm" class="col-sm-2 control-label">确认密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="user_pass_confirm" name="user_pass_confirm"
                                   datatype="yes_null|scope_string_2,*6-20"
                                   recheck="user_pass"
                                   nullmsg="请再次输入登录密码"
                                   errormsg="两次输入密码不一致"
                                   placeholder="确认密码">
                            <div class="Validform_checktip"></div>
                        </div>
                    </div>
            </div>
            <div class="modal-footer">
                <a href="javascript:void(0);" class="btn btn-default" role="button" data-dismiss="modal" style="float: left;">取&emsp;消</a>
                <button type="submit" class="btn btn-primary">确&emsp;认</button>
            </div>
            </form>
        </div>
    </div>
</div>

</body>
</html>
<!-- jQuery 2.2.3 -->
<script src="<?php echo STATIC_COMMON; ?>plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="<?php echo STATIC_ADMIN; ?>bootstrap/js/bootstrap.min.js"></script>
<!-- layer 3.0.3 -->
<script src="<?php echo STATIC_COMMON; ?>plugins/layer/layer.js"></script>

<!-- slimScroll 1.3.8 -->
<script src="<?php echo STATIC_ADMIN; ?>plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- Validform 5.3.2 -->
<script src="<?php echo STATIC_COMMON; ?>plugins/Validform/Validform_v5.3.2.js"></script>

<!-- other -->
<script src="<?php echo STATIC_ADMIN; ?>dist/js/app.js"></script>
<script src="<?php echo STATIC_ADMIN; ?>dist/js/yc_app.js"></script>
<script>
    $(function () {
        ycApp.setMainHeight();
        ycApp.iframeHeight();

        ycApp.initValidator();
    });

    // 根据窗口大小调整 main区域的高度
    $(window).resize(function() {
        ycApp.setMainHeight();
        ycApp.iframeHeight();
    });
    
    function activeMenu(obj) {
        var _this = $(obj);
        _this.addClass('active')
            .siblings().removeClass('active');
    }

    function iframeHeight() {
        var body = $('.content-wrapper').height();
        $('#main').css('height', body);
    }
    
    function user_logout() {
        $.getJSON('<?php echo site_url('Index/logout')?>', function (result) {
            //alert(result['msg']);
            window.location.href = result['url'];
        });
    }
</script>